import math
x=float(input())
k=2
def fun(x):
    return 3**x

x_lst=[math.pi/6,math.pi/4,math.pi/3]
y_lst=[0.5,math.sqrt(2)/2,math.sqrt(3)/2]

ans=0

for j in range(0,k+1):
    tem=1
    for i in range(0,k+1):
        #print("i=%d"%i)
        if i==j:
            continue
        tem*=x-x_lst[i]
        tem/=x_lst[j]-x_lst[i]
    tem*=y_lst[j]
    ans+=tem
print("%.3f"%ans)

